package com.novellotus.iov.carvice.activity;

import android.os.Bundle;
import android.widget.Button;
import android.widget.EditText;

import com.novellotus.iov.carvice.R;
import com.novellotus.iov.carvice.model.RegisterModel;
import com.novellotus.iov.carvice.utils.MyUtils;

import butterknife.BindView;
import butterknife.OnClick;


/**
 * 注册页面
 */
public class RegisterActivity extends BaseActivity {

    @BindView(R.id.edt_phone)
    EditText edt_phone;
    @BindView(R.id.btn_code)
    Button btn_code;
    @BindView(R.id.edt_code)
    EditText edt_code;
    @BindView(R.id.btn_next)
    Button btn_next;
    RegisterModel registerModel;

    @Override
    protected void initContentView(Bundle savedInstanceState) {
        setContentView(R.layout.activity_register);
    }

    @Override
    public void init() {
        MyUtils.addActivity(this);
        registerModel = new RegisterModel(this);
        registerModel.setEditPhone(edt_phone, btn_code);
        registerModel.setBtnCode(btn_code, edt_phone);
        registerModel.setEditCode(edt_code);
        registerModel.setButtonNext(btn_next, edt_phone, edt_code);
        registerModel.setConfirm(btn_next);
    }

    @OnClick(R.id.rlt_top)
    void back() {
        MyUtils.hideInput(this);
        finish();
    }


    @Override
    protected void onDestroy() {
        super.onDestroy();
        MyUtils.clearActivity();
    }
}
